import request from "@/utils/request";
const baseURL = process.env.VUE_APP_BASE_API;

// 分页查询列表操作
export function page(query) {
  return request({
    url: process.env.VUE_APP_KSTB_ROUTE_PATH + "/zcbl/case/pageList",
    method: "get",
    params: query
  });
}

// 查询办件详情
export function getById(id) {
  return request({
    url: process.env.VUE_APP_KSTB_ROUTE_PATH + "/zcbl/case/getById?id=" + id,
    method: "get"
  });
}

/**
 * 下载附件
 * @param {*} id
 */
export function downloadFile(materialOid) {
  window.location.href =
    baseURL +
    process.env.VUE_APP_KSTB_ROUTE_PATH +
    `/zcbl/caseAtta/downloadFile/${materialOid}`;
}

//修改跨省通办中的状态和详情，在审核通过后，保存到办件服务中
// export function saveOrUpdateCase(data) {
//   return request({
//     url:
//       process.env.VUE_APP_KSTB_ROUTE_PATH +
//       "/zcbl/case/yuShenCase?id=" +
//       data.id +
//       "&caseStatus=" +
//       data.caseStatus +
//       "&resultDesc=" +
//       data.resultDesc,
//     method: "post",
//     headers: {
//       "Content-Type": "application/json;charset=UTF-8"
//     }
//   });
// } 

//保存或者修改
export function saveOrUpdateCase(data) {
  return request({
    url: process.env.VUE_APP_KSTB_ROUTE_PATH + "/zcbl/case/yuShenCase",
    method: "post",
    headers: {
      "Content-Type": "application/json;charset=UTF-8"
    },
    data: data
  });
}


//查询办件状态
export function getRqbzFlagByCaseOid(caseOid) {  
  return request({
    url: process.env.VUE_APP_KSTB_ROUTE_PATH + "/web/infoManageService/getRqbzFlagByCaseOid?caseOid=" + caseOid,
    method: "get"
  });
}
 